'use strict'

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
	const { router, controller } = app
	router.get('/', controller.home.index)
	// uses- 登陆接口
	router.post('/api/login', controller.user.login)
	// 注册
	router.post('/api/register', controller.user.register)
	router.get('/api/users', controller.user.users)

	// blogs:restful
	router.get('/api/blogs', controller.blogs.listBlogs)
	router.post('/api/blogs', controller.blogs.addBlogs)
	router.put('/api/blogs/:articleId', controller.blogs.updateBlogs)
	router.delete('/api/blogs/:deleteId', controller.blogs.deleteBlogs)

	router.get('/api/list-test', controller.user.list)
	// router.post('/api/post-test', controller.user.post)
	// // 上传接口
	// router.post('/api/upload', controller.upload.upload)
}
